﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class EditorUtilityTest_Dialog
{
    //FocusProjectWindow 显示项目窗口
    //OpenPropertyEditor 打开物体的PropertyEditor
    //ClearDefaultParentObject清理默认父物体
    //SetDefaultParentObject 设置默认父物体

    //CollectDeepHierarchy
    //CollectDependencies 收集依赖
    //CompressCubemapTexture 压缩方块纹理
    //CompressTexture 压缩纹理

    //DisplayDialog 显示弹窗
    //DisplayDialogComplex 显示三个按钮弹窗
    //DisplayPopupMenu 显示弹出菜单

    //DisplayCancelableProgressBar 显示可取消的进度条
    //ClearProgressBar 关闭进度条
    //DisplayProgressBar 显示进度条

    //OpenFilePanel 打开文件管理器
    //OpenFilePanelWithFilters 打开带有过滤的文件管理器
    //OpenFolderPanel 打开文件夹
    //SaveFilePanel 保存文件
    //SaveFilePanelInProject 保存文件到项目中
    //SaveFolderPanel 保存文件夹

    //GetDirtyCount 获取脏标记数量
    //IsDirty 是否带有脏标记
    //ClearDirty清理脏标记
    //SetDirty 设置脏标记

    [MenuItem("EditorUtilityTest/Dialog/Dialog1")]
    public static void DisplayDialog1()
    {
        bool result = EditorUtility.DisplayDialog("title", "message", "ok");
        Debug.Log($"result:{result}");
    }
    [MenuItem("EditorUtilityTest/Dialog/Dialog2")]
    public static void DisplayDialog2()
    {
        var result = EditorUtility.DisplayDialog("title", "message", "ok", "cancel");
        Debug.Log($"result:{result}");
    }
    [MenuItem("EditorUtilityTest/Dialog/Dialog3")]
    public static void DisplayDialog3()
    {
        var result = EditorUtility.DisplayDialogComplex("title", "message", "ok", "cancel", "alt");
        Debug.Log($"result:{result}");
    }
}
